Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[charts] Add typedocs to pubic hooks and improve types #15545

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

JCQuintas
Copy link
Member

@JCQuintas JCQuintas commented Nov 21, 2024

  • added docs to all public hooks
  • Improve types of useXxxSeries hooks and add more use-cases

@JCQuintas JCQuintas added breaking change component: charts This is the name of the generic UI component, not the React module! v8.x labels Nov 21, 2024
@JCQuintas JCQuintas self-assigned this Nov 21, 2024
@mui-bot
Copy link

mui-bot commented Nov 21, 2024

Deploy preview: https://deploy-preview-15545--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 7a9241f

Copy link

codspeed-hq bot commented Nov 21, 2024

CodSpeed Performance Report

Merging #15545 will not alter performance

Comparing JCQuintas:remove-unstable-useseries (7a9241f) with master (ff2947d)

Summary

✅ 6 untouched benchmarks

@alexfauquette
Copy link
Member

I'm wondering if the current hook is the best DX. If we provide something like

useBarSeries(['seriesId1', 'seriesId2']) // Returns the config of the series
useBarSeries() // Returns all bar series in the correct order

It might be easier to use

@JCQuintas
Copy link
Member Author

Do you see a lot of value in returning an array for allowing multiple items to be returned or only allow one return per call?

const a = useSeries('a')
const b = useSeries('b')

vs

const [a,b] useSeries('a', 'b')

@alexfauquette
Copy link
Member

The array has the advantage to be easier to understand and to allow adding extra arguments later. But I'm not sure if passing an array like useBarSeries(['seriesId1', 'seriesId2']) could cause perf issue because at each render it would creat a new array 🤔

Maybe we should wait for the end of the plugin migration to see if one DX allows easier perf otpimisation than the other

@JCQuintas
Copy link
Member Author

The array has the advantage to be easier to understand and to allow adding extra arguments later. But I'm not sure if passing an array like useBarSeries(['seriesId1', 'seriesId2']) could cause perf issue because at each render it would creat a new array 🤔

Maybe we should wait for the end of the plugin migration to see if one DX allows easier perf otpimisation than the other

Optimisation-wise we can just ...args into the dep array. Though we have to disable the eslint error for exaustive deps 🙃

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 26, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

bernardobelchior added a commit to bernardobelchior/mui-x that referenced this pull request Feb 4, 2025
bernardobelchior added a commit to bernardobelchior/mui-x that referenced this pull request Feb 4, 2025
bernardobelchior added a commit to bernardobelchior/mui-x that referenced this pull request Feb 5, 2025
bernardobelchior added a commit to bernardobelchior/mui-x that referenced this pull request Feb 6, 2025
bernardobelchior added a commit to bernardobelchior/mui-x that referenced this pull request Feb 7, 2025
@JCQuintas JCQuintas force-pushed the remove-unstable-useseries branch from 6d2192a to 7a70ef4 Compare February 7, 2025 18:17
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 7, 2025
@JCQuintas JCQuintas changed the title [charts] Stabilize useSeries and useXxxSeries hooks [charts] Document public hooks and improve types Feb 7, 2025
@JCQuintas JCQuintas changed the title [charts] Document public hooks and improve types [charts] Add typedocs to pubic hooks and improve types Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: charts This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants